<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="d" uri="http://dgg.net/jsp/jstl/core" %>

<!DOCTYPE html>
<html>

<head>
    <meta charset="UTF-8">
    <title>事业部移交记录</title>
    <c:import url="../../header.jsp"/>
    <link rel="stylesheet" href="${baseStaticUrl}/static/plugs/ztree/css/zTreeStyle/zTreeStyle.css?v=${version}">
    <script> var ALLOT_REFUSED = '${ALLOT_REFUSED}';</script>
</head>
<body>
<div class="body-main">
    <div class="titleSearch">
        <div class="layui-inline">
            <label>客户电话：</label>
            <div class="layui-input-inline">
                <input name="customerPhone" type="text" class="input-style" maxlength="50"
                       placeholder="请输入客户电话">
            </div>
        </div>
        <div class="layui-inline">
            <label>关键字：</label>
            <div class="layui-input-inline">
                <input name="searchKey" type="text" class="input-style" maxlength="60" style="width:280px"
                       placeholder="客户名/订单编号/生产订单编号/签单人/移交人">
            </div>
        </div>
        <div class="layui-inline">
            <label>移交时间：</label>
            <div class="layui-inline">
                <input type="text" name="startTransferDate" placeholder="开始时间" class="Wdate input-style" id="startTransferDate"
                       onfocus="var endTransferDate=$dp.$('endTransferDate'); WdatePicker({onpicked:function(){endTransferDate.focus();}, maxDate:'#F{ $dp.$D(\'endTransferDate\')}', dateFmt:'yyyy-MM-dd'})">
            </div>
            <span>~</span>
            <div class="layui-inline">
                <input type="text" name="endTransferDate" placeholder="结束时间" class="Wdate input-style" id="endTransferDate"
                       onfocus="WdatePicker({minDate:'#F{$dp.$D(\'startTransferDate\')}', dateFmt:'yyyy-MM-dd'})">
            </div>
        </div>
        <div class="layui-inline">
            <label>签单时间：</label>
            <div class="layui-inline">
                <input type="text" name="startSignDate" placeholder="开始时间" class="Wdate input-style" id="startSignDate"
                       onfocus="var endSignDate=$dp.$('endSignDate'); WdatePicker({onpicked:function(){endSignDate.focus();}, maxDate:'#F{ $dp.$D(\'endSignDate\')}', dateFmt:'yyyy-MM-dd'})">
            </div>
            <span>~</span>
            <div class="layui-inline">
                <input type="text" name="endSignDate" placeholder="结束时间" class="Wdate input-style" id="endSignDate"
                       onfocus="WdatePicker({minDate:'#F{$dp.$D(\'startSignDate\')}', dateFmt:'yyyy-MM-dd'})">
            </div>
        </div>
        <div class="layui-inline">
            <button class="layui-btn layui-btn-mini layui-btn-normal" onclick="dataTableReload()">搜索</button>
            <button class="layui-btn layui-btn-mini layui-btn-primary" onclick="cleanSearch()">清空</button>
        </div>
        </div>
    </div>
    <div class="table-body">
        <!--表格 start-->
        <table id="orgOrderTransferRecordJsonTable" class="cell-border crm-table columnsHidden dataTable">
            <thead>
            <tr>
                <th width="20"><input type="checkbox" class="checkall"/></th>
                <th width="50">序号</th>
                <th>订单来源</th>
                <th>订单编号</th>
                <th>客户</th>
                <th>签单时间</th>
                <th>签单商务</th>
                <th>签单部门</th>
                <th>移交人</th>
                <th>移交时间</th>
            </tr>
            </thead>
            <tbody>

            </tbody>
        </table>
        <!--表格 end-->
    </div>
</div>
<c:import url="/WEB-INF/jsp/footer.jsp"/>
<script type="text/javascript">
    var NORMAL = '${NORMAL}', TIME_OUT = '${TIME_OUT}';
</script>
<script type="text/javascript"
        src="${basePath}/static/js/choose.extend.js?v=${version}"></script>
<script type="text/javascript" src="${basePath}/static/js/zzsc/production/sc_common.js?v=${version}"></script>
<script type="text/javascript" src="${basePath}/static/js/zzsc/common/call_common.js?v=${version}"></script>
<script type="text/javascript" src="${basePath}/static/js/zzsc/inprocess/inprocess_list.js?v=${version}"></script>
<script src="${rootUrl}/static/js/zzsc/common/sc_chooseUser.js?v=${version}" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript">
Plug.plug_in("post", "${basePath}/zzsc/common/tree_book_list.do?code=BUS_YT_ZZ&&type=2&&level=3", "#business_typeCode", '选择业态', '', true, 'BUS_YT_ZZ', '', '');
</script>
<script type="text/javascript">
$(function(){
	commonTreeBookCode("#orderStatus","ZZSC_PRODUCT_STATUS",1,1,1,true);//初始化订单状态
});

    // 获取搜索数据
    function getSearchData() {
        return $.extend($('.main-title').serializeJson(), $('.titleSearch').serializeJson());
    }

    $(document).ready(function () {
        //初始化dataTable列表
		//初始化dataTable列表
        table = $('#orgOrderTransferRecordJsonTable').dataTableExtend({
            "ajax": {"url": "${basePath}/sc/org/orgOrderTransferRecordJson.do", "type": "post"},
            "fnServerParams": function (aoData) {
                aoData = $.extend(aoData, getSearchData());
                return aoData;
            },
            "scrollX": "true",//是否开启横项滚动
            "fixedColumns": {//锁定列，只有开启scrollX时才生效
                "leftColumns": 3,//左侧锁定2列
                "rightColumns": 1//右侧锁定1列
            },
            "aoColumns": [
                {
                    "orderable": false,
                    "data": "id",
                    "render": function (data, type, full, meta) {
                        return '<input type="checkbox"  name="ids" class="checkchild"  value="' + data + '" />';
                    }
                }
                , {
                    "orderable": false,
                    "render": function (data, type, full, meta) {
                        return meta.row + 1;
                    }
                }, {
                    "orderable": false,
                    "data": "signOrgName",
                    "render": function (data, type, full, meta) {
                        return data ? data : '';
                    }
                }, {
                    "orderable": false,
                    "data": "orderNo",
                    "render": function (data, type, full, meta) {
                   	 return ('<a href=\'javascript:void(0)\' ti  onclick="openBusinessDetail(\'' + full.orderNo + '\',\'' + full.orderId + '\')" /><span class="layui-table-link">' + data + '</span></a>&nbsp;');
                    }
                },
                {
                    "orderable": false,
                    "data": "customerName",
                    "render": function (data, type, full, meta) {
                   	  return emptyStringConvert(full.customerName) + '<p>' + emptyStringConvert(full.customerPhone) + '</p>';
                    }
                },
                {
                    "orderable": true,
                    "data": "signTime",
                    "render": function (data, type, full, meta) {
                        return data ? data : '';
                    }
                },
                {
                    "orderable": false,
                    "data": "signUserName",
                    "render": function (data, type, full, meta) {
                        return data ? data : '';
                    }
                },   {
                    "orderable": false,
                    "data": "signUserOrgName",
                    "render": function (data, type, full, meta) {
                        return data ? data : '';
                    }
                },{
                    "orderable": false,
                    "data": "transferUserName",
                    "render": function (data, type, full, meta) {
                        return data ? data : '';
                    }
                },{
                    "orderable": false,
                    "data": "transferTime",
                    "render": function (data, type, full, meta) {
                        return data ? data : '';
                    }
                }]

        });
    });

</script>
</body>

</html>